import React from 'react';
import { Card } from 'antd';

interface PageLayoutProps {
  children: React.ReactNode;
  title?: string;
  extra?: React.ReactNode;
}

const PageLayout: React.FC<PageLayoutProps> = ({
  children,
  title,
  extra
}) => {
  if (title) {
    return (
      <Card title={title} extra={extra} variant="borderless">
        {children}
      </Card>
    );
  }

  return <>{children}</>;
};

export default PageLayout;